{% include "../common/_app_css.html" %}
<div class="layui-fluid" id="app">
    <el-card class="box-card app-min-view">
        <div slot="header" class="clearfix">
            <span>网站信息设置</span>
        </div>
        <el-form ref="modelForm" class="app-setting-form" :model="modelForm" label-width="80px">
            <el-form-item label="域名">
                <el-input v-model="modelForm.Domain"></el-input>
            </el-form-item>
            <el-form-item label="标题">
                <el-input v-model="modelForm.Title"></el-input>
            </el-form-item>
            <el-form-item label="关键字">
                <el-input v-model="modelForm.Keyword"></el-input>
            </el-form-item>
            <el-form-item label="描述">
                <el-input v-model="modelForm.Description"></el-input>
            </el-form-item>
            <el-form-item label="联系邮箱">
                <el-input v-model="modelForm.Email"></el-input>
            </el-form-item>
            <el-form-item label="联系人">
                <el-input v-model="modelForm.Contact"></el-input>
            </el-form-item>
            <el-form-item label="公司名称">
                <el-input v-model="modelForm.Company"></el-input>
            </el-form-item>
            <el-form-item label="联系电话">
                <el-input v-model="modelForm.Phone"></el-input>
            </el-form-item>
            <el-form-item label="备案ICP">
                <el-input v-model="modelForm.Icp"></el-input>
            </el-form-item>
            <el-form-item label="地址">
                <el-input v-model="modelForm.Address"></el-input>
            </el-form-item>
            <el-form-item label="模板名称">
                <el-input v-model="modelForm.Tpl"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button>取消</el-button>
                {#<el-button type="primary" @click="updateData">确认</el-button>#}
            </el-form-item>
        </el-form>
    </el-card>
</div>
{% include "../common/_app_js.html" %}
<script>
    var vm = app.vue({
        el: '#app',
        data() {
            return {
                loading: false,
                modelForm: {
                },
            }
        },
        created() {
            this.getList()
        },
        methods: {
            getList() {
                app.request({
                    method: 'get',
                    url: 'system/setting/list',
                }).then((res) => {
                    this.modelForm = res?.data?.rows

                    setTimeout(() => {
                        this.loading = false
                    }, 80)
                })
            },
            updateData() {
                this.$refs.modelForm.validate(valid => {
                    if (valid) {
                        app.request({
                            method: 'put',
                            url: 'system/setting/update',
                            data: this.modelForm,
                        }).then(() => {
                            this.$refs.modelForm.resetFields()
                            this.getList()

                            this.$notify({
                                title: 'Success',
                                message: '修改成功',
                                type: 'success',
                                duration: 2000
                            })
                        })
                    }
                })
            }
        }
    })
</script>
